/**
 * User模块
 */
import types from '../../types'
const user = {
  state: {
    count: 6
  },
  actions: {
    increment: ({commit}) => {
      commit(types.INCREMENT)
    },
    decrement: ({commit, state}) => {
      if (state.count > 10) {
        commit(types.DECREMENT)
      }
    }
  },
  mutations: {
    [types.INCREMENT]: (state) => {
      state.count++
    },
    [types.DECREMENT]: (state) => {
      state.count--
    }
  }
}

export default user
